from fastapi import Request
from starlette.middleware.base import BaseHTTPMiddleware
from starlette.responses import Response

class FilterMiddleware(BaseHTTPMiddleware):
    async def dispatch(self, request: Request, callNext):
        # 过滤掉不需要的请求
        if request.url.path in [
            "/.well-known/appspecific/com.chrome.devtools.json"
        ]:
            return Response(status_code=200)
        return await callNext(request) 